<!-- 商品列表组件 <good-list :list="xx"></good-list> -->
<template>
	<view class="scroll-view_H">
	<view class="" v-for="good in list" :key="good.id">
		<view class="Item">
			<view class="item-link item-content">
				<!--<div class="item-media"></div>-->
				
					<view v-if="good.盘点状态=='未盘'">
						<view class="item-inner" @tap="stockWpAsset($event)" :data-Id="good.AssetId">
					              <view class="item-text">
										<view  class="ispan" 
										style="background-color:#6D8AF9;width: 60rpx;color:#FFFFFF;padding: 0 10rpx;margin-right: 10rpx;">待盘</view>
										<view class="ispan">资产编码：{{good.资产编码}}</view>
									  </view>
									  <view class="item-text">
										<view class="ispan">盘点人：admin</view>
									  </view>
									  <view class="item-text">
										<view class="ispan">盘点日期：-</view>
									  </view>
									  <view class="item-text">
										<view class="ispan">所在城市：-</view>
									  </view>
									  </view>
					           </view>  
					           <view v-else>  
							   <view class="item-inner" @tap="stockAsset($event)" :data-Id="good.AssetId">
									  <view class="item-text">
										<view  class="ispan" 
										style="background-color:#BEBEBE;width: 60rpx;color:#FFFFFF;padding: 0 10rpx;margin-right: 10rpx;">已盘</view>
										<view class="ispan">资产编码：{{good.资产编码}}</view>
									  </view>
									  <view class="item-text">
										<view class="ispan">盘点人：admin</view>
									  </view>
									  <view class="item-text">
										<view class="ispan">盘点日期：{{good.盘点日期}}</view>
									  </view>
									  <view class="item-text">
										<view class="ispan">所在城市：{{currAddress}}</view>
									  </view>
								  </view>
					           </view>
				
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	var self;
	export default {
		props:{
			list: {
				type: Array,
				default(){
					return []
				}
			},
			currAddress:""
		},
		onLoad() {
			/*
			uni.getLocation({
				type: 'wgs84',
				success: function(res) {
					var point = new plus.maps.Point(res.longitude, res.latitude);
					plus.maps.Map.reverseGeocode(
						point, {},
						function(event) {
							var address = event.address; // 转换后的地理位置
							var point = event.coord; // 转换后的坐标信息
							var coordType = event.coordType; // 转换后的坐标系类型
							var reg = /.+?(省|市|自治区|自治州|县)/g;
							//var reg = /.+?(省|市|自治区|自治州|县)/g;
							self.currAddress = address.match(reg)[0];
							
						},
						function(e) {}
					);
				}
			});
			*/
		},
		methods: {
			stockAsset(e) {
				uni.navigateTo({
					url: '../stock/StockDocumentAsset?AssetId=' + e.currentTarget.dataset.id,
				});				
			},
			stockWpAsset(e) {
				console.log("12");
				uni.navigateTo({
					url: '../stock/StockDocumentAsset',
				});				
			}
		}
	}
</script>

<style >
	.scroll-view_H{
		background-color: #f9f9f9;
		margin-top: 120rpx;
		padding-left: 10px;
		padding-right: 10px;
	}
	.Item {
		border: 1px solid #e6e6e6;
		overflow: hidden;
		padding-bottom: 16rpx;
		border-radius: 16rpx;
		background: #fff;
		margin-top: 10rpx;
	}
	
	.item-text .span {
		display: inline-block;
		width: 45%;
		float: right;
	}
	
	.item-text .ispan {
		font-style: normal;
		width: 83%;
		display: inline-block;
	}
	
	.item-content {
		padding-left: 0;
	}
	
	.item-title .ispan {
		font-size: 30rpx;
		width: auto;
		height: auto;
	}
	
	.item-title {
		font-size: 40rpx;
		color: #454545;
		width: 100%;
	}
	
	.item-title-row {
		background-image: none;
		padding-right: 0px;
	}
	
	.item-link .item-inner {
		padding-right: 0;
	}
	.item-text {
		font-size: 30rpx;
		color: #454545;
		margin: 20rpx 0;
		padding-left: 20rpx;
		line-height: 1.2;
	}
</style>
